Session Storage in JavaScript provides the following methods for storing and managing data:
setItem(key, value) – Stores a key-value pair in session storage.
getItem(key) – Retrieves the value associated with the specified key.
removeItem(key) – Removes the specified key and its value from session storage.
clear() – Clears all key-value pairs from session storage.
key(index) – Returns the key at the specified index in session storage.
length – Returns the number of key-value pairs in session storage.